#!/usr/bin/env python

import optparse
import pyglet
import random

pyglet.resource.path.extend(['audio', 'font', 'map', 'texture'])
pyglet.resource.reindex()

from mechazoid import main
from mechazoid import faction

faction_names = [f.name.lower() for f in faction.factions]

parser = optparse.OptionParser()
parser.add_option('--host', '--hostname', dest='host', default='localhost',
	help='What hostname does the multiplayer server listen on? [%default]')
parser.add_option('--port', dest='port', type='int', default=4242,
	help='What port does the multiplayer server listen on? [%default]')
parser.add_option('--client', dest='client', action='store_true', default=False,
	help='Are we a client of the multiplayer game? [%default]')
parser.add_option('--player-name', dest='player_name', default='Player',
	help="What's the player's name? [%default]")
parser.add_option('--faction', dest='faction', default=random.choice(faction_names),
	help="What's the player's faction (%s)? [%%default]" % \
		', '.join(faction_names))
parser.add_option('--latency', dest='latency', type='float', default=None,
	help='How much network latency should we simulate (in seconds)? [%default]')
parser.add_option('--packet-loss', dest='packet_loss', type='float', default=None,
	help='How much network packet loss should we simulate (in seconds)? [%default]')
opts, args = parser.parse_args()

main.main(opts)

